package yc.day0109.travelt.constants;

public enum TourRouteType {
    ONE(1,"自由行"),
    TWO(2,"纯玩团");
    private int code;
    private String value;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    TourRouteType(int code, String value) {
        this.code = code;
        this.value = value;
    }

    public static TourRouteType getTourRouteTypeByCode(int code){
        switch (code){
            case 0:
                return ONE;
            case 1:
                return TWO;
            default:
                return ONE;
        }
    }
}
